// Copyright (c) 2005  INRIA Sophia-Antipolis (France).
// All rights reserved.
//
// This file is part of cgal-python; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; version 2.1 of the License.
// See the file LICENSE.LGPL distributed with cgal-python.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $Id: Py_Tetrahedron_3.cpp 167 2007-11-02 15:36:54Z spion $
// $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal-python/trunk/cgal-python/bindings/Kernel/Py_Tetrahedron_3.cpp $
//
// Author(s)     : Naceur Meskini
//=========================================================================

#include <CGAL/basic.h>
#include <include/Kernels.h>

#include <boost/python.hpp>
#include <boost/cstdint.hpp>

const char* Tetrahedron_3_doc[]={
"An object t of the class Tetrahedron_3 is an oriented tetrahedron in the three-dimensional Euclidean space.\n\
It is defined by four vertices p0, p1, p2 and p3. The orientation of a tetrahedron is the orientation of its four vertices.\n\
That means it is positive when p3 is on the positive side of the plane defined by p0, p1 and p2.\n\
The tetrahedron itself splits the space 3 in a positive and a negative side.\n\
The boundary of a tetrahedron splits the space in two open regions, a bounded one and an unbounded one.\n\n\
For more details see a C++ documentation:\n\
http://www.cgal.org/Manual/3.2/doc_html/cgal_manual/Kernel_23_ref/Class_Tetrahedron_3.html",

"t = Tetrahedron_3( Point_3 p0, Point_3 p1,Point_3 p2, Point_3 p3)\n\
 introduces a tetrahedron t with vertices p0, p1, p2 and p3.",

"t.vertex(self,int i) -> Point_3\nreturns the i'th vertex modulo 4 of t.",

"t.transform(self, Aff_transformation_3 t) -> Tetrahedron_3\n\
returns the tetrahedron obtained by applying at on the three vertices of t.",

"t.bounded_side(self,Point_3 p) -> Bounded_side\n\
Precondition: : t is not degenerate.",

"t.oriented_side (self,Point_3 p) -> Oriented_side\n\
Precondition: : t is not degenerate.",

"t.has_on_boundary(self,Point_3 p) ->bool",

"t.has_on_bounded_side(self,Point_3 p) ->bool",

"t.has_on_unbounded_side(self,Point_3 p) ->bool",

"c.has_on_negative_side(self , Point_3 p) -> bool",

"c.has_on_positive_side(self , Point_3 p) -> bool",

"t.is_degenerate(self) ->bool\nTetrahedron t is degenerate, if the vertices are coplanar.",

"t.bbox(self) -> Bbox_3\nreturns a bounding box containing t. ",

"t.orientation(self) -> Orientation\nreturns the orientation of t.",

"t.volume(self) -> double\nreturns the volume of t."
};

template<class Tetrahedron_3>
boost::python::str py_repr_Tetrahedron_3(const Tetrahedron_3& t )
{
	using namespace boost::python;
	return str("Tetrahedron_3("+ str(t.vertex(0)) +","+ str(t.vertex(1))+","+ str(t.vertex(2)) +","+ str(t.vertex(3))+","+ str(t.orientation())+")" );
}

template <class kernel > 
void Py_Tetrahedron_3()
{
	typedef typename kernel::Point_3 						Point_3;
 	typedef typename kernel::Tetrahedron_3 						Tetrahedron_3;

	using namespace boost::python;

        class_< Tetrahedron_3 >("Tetrahedron_3", Tetrahedron_3_doc[0],init<  >())
        .def(init< const Tetrahedron_3& >(Tetrahedron_3_doc[1]))
        .def(init< const Point_3&, const Point_3&, const Point_3&, const Point_3& >())
        .def("vertex", &Tetrahedron_3::vertex, BEF_33(by_cref, by_copy)(), Tetrahedron_3_doc[2])
        .def("transform", &Tetrahedron_3::transform, Tetrahedron_3_doc[3])
        .def("bounded_side", &Tetrahedron_3::bounded_side, Tetrahedron_3_doc[4])
        .def("oriented_side", &Tetrahedron_3::oriented_side, Tetrahedron_3_doc[5])
        .def("has_on_boundary", &Tetrahedron_3::has_on_boundary, Tetrahedron_3_doc[6])
        .def("has_on_bounded_side", &Tetrahedron_3::has_on_bounded_side, Tetrahedron_3_doc[7])
        .def("has_on_unbounded_side", &Tetrahedron_3::has_on_unbounded_side, Tetrahedron_3_doc[8])
        .def("has_on_negative_side", &Tetrahedron_3::has_on_negative_side, Tetrahedron_3_doc[9])
        .def("has_on_positive_side", &Tetrahedron_3::has_on_positive_side, Tetrahedron_3_doc[10])
        .def("is_degenerate", &Tetrahedron_3::is_degenerate, Tetrahedron_3_doc[11])
        .def("bbox", &Tetrahedron_3::bbox, Tetrahedron_3_doc[12])
	.def("orientation", &Tetrahedron_3::orientation, Tetrahedron_3_doc[13])
       	.def("volume", &Tetrahedron_3::volume, Tetrahedron_3_doc[14])
        .def("__repr__", &py_repr_Tetrahedron_3<Tetrahedron_3>)

        .def( self == self )
        .def( self != self )
    ;
}

void export_Tetrahedron_3()
{
	Py_Tetrahedron_3<K>();
}
